package com.youlu.campus.entity;

import com.youlu.campus.base.base.EntityBase;
import lombok.Data;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * 领取电子证书规则配置
 */
@Data
@Document(collection = "receiveCertificateRule")
public class ReceiveCertificateRule extends EntityBase {

    public static final String RECEIVE_TYPE_DEFAULT = "default";

    public static final String RECEIVE_TYPE_OTHER = "other";

    @Indexed(unique = true)
    private String activityId;
    private String activityName;
    //类型 defalut other 其他逻辑
    private String type = RECEIVE_TYPE_DEFAULT;
    //领取值 等于0无需限制领取值
    private Integer receiveValue =0;
    /**
     * 是否需要领取计算
     * 如果领取类型type 等于default 无需考虑此值;
     * 如果领取类型type 等于other 并且当前等于true 计算相关值;
     */
    private Boolean receiveCalculation = Boolean.FALSE;

    private String signUpActivityId;

    private String errorMsgTips;

    private Boolean ca = Boolean.TRUE;


    public Boolean equalsDefault(String type){
        if(RECEIVE_TYPE_DEFAULT.equals(type)){
            return Boolean.TRUE;
        }
       return Boolean.FALSE;
    }


}
